<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="${pageContext.request.contextPath}/themes/bootstrap/easyui.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/themes/icon.css" rel="stylesheet">
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/easyui-lang-zh_CN.js"></script>
<script	src="${pageContext.request.contextPath}/js/jquery.backstretch.js"></script>
<link href="${pageContext.request.contextPath}/css/bootstrap.min.css" rel="stylesheet">

<title>显示部门信息</title>
</head>
<script type="text/javascript">
   $(function(){
	
	//配置表格
	    $('#tb').datagrid({    
		    url:'${pageContext.request.contextPath}/findDept',    
		    columns:[[   
                
		        {field:'dept_id',title:'部门id',width:100,hidden:true},    
		        {field:'dept_name',title:'部门名字',width:362},    
		        {field:'dept_describe',title:'部门描述',width:362}, 
		        {field:'dept_temp',title:'temp',hidden:true,width:100}, 
		        {field:'dept_createtime',title:'创建时间',width:362}, 
		        {field:'dept_isdel',title:'是否删除',width:100,hidden:true,align:'right'}    
		    ]],
		    onLoadError: function(){
	            $.messager.alert('提示','没有符合条件的搜索结果！');
	            $('#searchBox').searchbox('clear');
	        },
		     striped:true,
	         pagination:true,
	         
	 });
		 //配置搜索框
		 $('#searchBox').searchbox({ 
			 searcher:function(value,name){ 
				 var dept_name = value;
				 
			  		$('#tb').datagrid('reload',{
			  			searchname:dept_name
			  			
			  		});
			  		$('#searchBox').searchbox('clear');
			      }, 
			     
			 });
		 
		  // 配置取消搜索     传个空值过去
	        $("#ss").click(function(){
	        	$('#searchBox').searchbox('clear');
	        	$('#tb').datagrid('reload', {
	        		
				});   			
	        });
	

});      
      
</script>
<body>
   
    
     <input id="searchBox" class="easyui-searchbox" data-options="prompt:'输入部门名查询信息',width:150,height:30">
     <a id="ss" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-back',height:30">返回</a>
     <h2 align="center"style="color:#FFFFFF">部门信息表</h2>
     <table id="tb" rownumbers="true" fitColumns="true" singleSelect="true" ></table> 

</body>
</html>